package sy.model.base;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "tcompany", catalog = "")
public class Tcompany implements java.io.Serializable {

	private String id;
	private Date created;
	private String name;
	private boolean systemdata;
	private Date updated;
	private Set<Trole> troles = new HashSet<Trole>(0);
	private Set<Torganization> torganizations = new HashSet<Torganization>(0);
	private Set<Tuser> tusers = new HashSet<Tuser>(0);

	public Tcompany() {
	}

	public Tcompany(String id, Date created, String name, boolean systemdata, Date updated) {
		this.id = id;
		this.created = created;
		this.name = name;
		this.systemdata = systemdata;
		this.updated = updated;
	}

	public Tcompany(String id, Date created, String name, boolean systemdata, Date updated, Set<Trole> troles, Set<Torganization> torganizations, Set<Tuser> tusers) {
		this.id = id;
		this.created = created;
		this.name = name;
		this.systemdata = systemdata;
		this.updated = updated;
		this.troles = troles;
		this.torganizations = torganizations;
		this.tusers = tusers;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created", nullable = false, length = 19)
	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "systemdata", nullable = false)
	public boolean isSystemdata() {
		return this.systemdata;
	}

	public void setSystemdata(boolean systemdata) {
		this.systemdata = systemdata;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated", nullable = false, length = 19)
	public Date getUpdated() {
		return this.updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tcompany")
	public Set<Trole> getTroles() {
		return this.troles;
	}

	public void setTroles(Set<Trole> troles) {
		this.troles = troles;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tcompany")
	public Set<Torganization> getTorganizations() {
		return this.torganizations;
	}

	public void setTorganizations(Set<Torganization> torganizations) {
		this.torganizations = torganizations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tcompany")
	public Set<Tuser> getTusers() {
		return this.tusers;
	}

	public void setTusers(Set<Tuser> tusers) {
		this.tusers = tusers;
	}

}
